<?php

/**
 * 数据表操作
 * @author Shaun
 */

namespace Member\Table;

use Utility\ServiceLocator\ServiceLocator;
use Zend\Db\TableGateway\TableGateway;
// 日志
use Utility\Log\Logger;
use Zend\Db\Sql\Select;
use Authority\Authority\Authority;

class AdminTable {

    /**
     * 渲染出类的相关信息
     * @return \Zend\Db\TableGateway\TableGateway
     */
    protected static function getAdminGateway() {
        return ServiceLocator::getServiceLocator()->get('Member\Model\AdminTable');
    }

    //获取所有信息
    /**
     * 渲染出类的相关信息
     * @return \Member\Model\AdminModel
     */
    public static function selectAll() {
        try {
            $result = self::getAdminGateway()->select(array("id" => '1'));
            return $result;
        } catch (Exception $exc) {
            Logger::getLogger()->warn(__CLASS__ . "::" . __FUNCTION__ . "  [ " . $exc->getPrevious() . " ]");
            return false;
        }
    }

    //新增
    /**
     * 渲染出类的相关信息
     * @return \Member\Model\AdminModel
     */
    public static function insertInto() {

    }

    //修改
    /**
     * 渲染出类的相关信息
     * @return \Member\Model\AdminModel
     */
    public static function edit() {
        try {
            $result = self::getAdminGateway()->select(array("id" => '1'));
            return $result;
        } catch (Exception $exc) {
            Logger::getLogger()->warn(__CLASS__ . "::" . __FUNCTION__ . "  [ " . $exc->getPrevious() . " ]");
            return false;
        }
    }

}
